package cn.lttest.user.dao;

import java.sql.SQLException;

import org.apache.commons.dbutils.handlers.BeanHandler;

import cn.com.hkr.jdbc.TxQueryRunner;
import cn.lttest.user.entity.User;

public class UserDao {
	private  TxQueryRunner qr = new TxQueryRunner();

	public User findByUsername(String username) {
		String sql = "select * from person where username = ?";
		try {
			return qr.query(sql, new BeanHandler<User>(User.class),username);
		} catch (SQLException e) {
			throw new RuntimeException(e);
		}
		
	}
	
	
	
	
	
}	
